<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="../common/baseCss.jsp" %>
<title>更新角色 - 管理员管理</title>
</head>
<body>
	<article class="page-container">
		<form action="" method="post" class="form form-horizontal" id="roleEditForm">
			<input type="hidden" value="${role.rleId}" id="rleId" name="rleId">
			<input type="hidden" value="${role.rleName}" id="oriRleName">
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">
					<span class="c-red">*</span>角色名称：
				</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="${role.rleName}" id="rleName" name="rleName"><span id="nameTip"></span>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">
					<span class="c-red">*</span>是否为认证角色：
				</label>
				<div class="formControls col-xs-8 col-sm-9">
					<c:if test="${role.verify == 1}">
						<input type="radio" class="input-radio" name="verify" value="1" checked="checked">是
						<input type="radio" class="input-radio" name="verify" value="0">否
					</c:if>
					<c:if test="${role.verify == 0}">
						<input type="radio" class="input-radio" name="verify" value="1">是
						<input type="radio" class="input-radio" name="verify" value="0" checked="checked">否
					</c:if>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">备注：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="${role.rleDesc}" id="rleDesc" name="rleDesc">
				</div>
			</div>
				
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">资源：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<dl class="permission-list">
						<dd id = "roleReses">
							<dl class="cl permission-list2" style="border-bottom: none;">
								<c:forEach items="${resources}" varStatus="num" var="resource" begin="0" end="${fn:length(resources)}">
									<dt style="width: 150px">
										<label class="">
								 			<c:if test="${reses[num.index] == 1}">
								 				<input type="checkbox" checked="checked" value="${resource.resId}" name="resIds"> ${resource.resName}
								 			</c:if>
								 			<c:if test="${reses[num.index] == 0}">
								 				<input type="checkbox" value="${resource.resId}" name="resIds"> ${resource.resName}
								 			</c:if>
										</label>
									</dt>
								</c:forEach>
							</dl>
						</dd>
					</dl>
				</div>
			</div>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
					<button type="submit" class="btn btn-success radius" id="role_update" name="role_update">
						<i class="icon-ok"></i> 确定
					</button>
				</div>
			</div>
		</form>
	</article>

	<%@ include file="../common/baseJs.jsp" %>
	<script type="text/javascript" src="manager/js/role/role_edit.js"></script>
</body>
</html>